package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosDsMappingMapper;
import com.ruoyi.net.domain.ElementQosDsMapping;
import com.ruoyi.net.service.IElementQosDsMappingService;

/**
 * 网元-QOS配置-DS域配置-映射关系Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosDsMappingServiceImpl implements IElementQosDsMappingService 
{
    @Autowired
    private ElementQosDsMappingMapper elementQosDsMappingMapper;

    /**
     * 查询网元-QOS配置-DS域配置-映射关系
     * 
     * @param id 网元-QOS配置-DS域配置-映射关系主键
     * @return 网元-QOS配置-DS域配置-映射关系
     */
    @Override
    public ElementQosDsMapping selectElementQosDsMappingById(String id)
    {
        return elementQosDsMappingMapper.selectElementQosDsMappingById(id);
    }

    /**
     * 查询网元-QOS配置-DS域配置-映射关系列表
     * 
     * @param elementQosDsMapping 网元-QOS配置-DS域配置-映射关系
     * @return 网元-QOS配置-DS域配置-映射关系
     */
    @Override
    public List<ElementQosDsMapping> selectElementQosDsMappingList(ElementQosDsMapping elementQosDsMapping)
    {
        return elementQosDsMappingMapper.selectElementQosDsMappingList(elementQosDsMapping);
    }

    /**
     * 新增网元-QOS配置-DS域配置-映射关系
     * 
     * @param elementQosDsMapping 网元-QOS配置-DS域配置-映射关系
     * @return 结果
     */
    @Override
    public int insertElementQosDsMapping(ElementQosDsMapping elementQosDsMapping)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosDsMapping.getId())) {
            elementQosDsMapping.setId(uuid);
        }
        elementQosDsMapping.setCreateBy(SecurityUtils.getUsername());
        elementQosDsMapping.setCreateTime(DateUtils.getNowDate());
        elementQosDsMapping.setUpdateBy(SecurityUtils.getUsername());
        elementQosDsMapping.setUpdateTime(DateUtils.getNowDate());
        return elementQosDsMappingMapper.insertElementQosDsMapping(elementQosDsMapping);
    }

    /**
     * 修改网元-QOS配置-DS域配置-映射关系
     * 
     * @param elementQosDsMapping 网元-QOS配置-DS域配置-映射关系
     * @return 结果
     */
    @Override
    public int updateElementQosDsMapping(ElementQosDsMapping elementQosDsMapping)
    {
        elementQosDsMapping.setUpdateBy(SecurityUtils.getUsername());
        elementQosDsMapping.setUpdateTime(DateUtils.getNowDate());
        return elementQosDsMappingMapper.updateElementQosDsMapping(elementQosDsMapping);
    }

    /**
     * 批量删除网元-QOS配置-DS域配置-映射关系
     * 
     * @param ids 需要删除的网元-QOS配置-DS域配置-映射关系主键
     * @return 结果
     */
    @Override
    public int deleteElementQosDsMappingByIds(String[] ids)
    {
        return elementQosDsMappingMapper.deleteElementQosDsMappingByIds(ids);
    }

    /**
     * 删除网元-QOS配置-DS域配置-映射关系信息
     * 
     * @param id 网元-QOS配置-DS域配置-映射关系主键
     * @return 结果
     */
    @Override
    public int deleteElementQosDsMappingById(String id)
    {
        return elementQosDsMappingMapper.deleteElementQosDsMappingById(id);
    }
}
